#include <iostream>
#include <string>
using namespace std;

int main()
{
    int n;
    char c;
    string s;
    cin>>n>>c;
    cin.get();
    getline(cin,s);
    if (s.size()<=n)
    {
        for (int i=0;i<n-int(s.size());i++)
            cout<<c;
        cout<<s;
    }
    else
    {
        for (int i=s.size()-n;i<s.size();i++)
            cout<<s[i];
    }
}